Skip to content

fix(desktop): persist workbar collapse per session - #4694

Open
DaBestCode wants to merge 1 commit into
apache:mainfrom
DaBestCode:codex/fix-session-workbar-collapse-4693
Open

fix(desktop): persist workbar collapse per session#4694
DaBestCode wants to merge 1 commit into
apache:mainfrom
DaBestCode:codex/fix-session-workbar-collapse-4693

Conversation

@DaBestCode

@DaBestCode DaBestCode commented Sep 3, 2026

Copy link
Copy Markdown

Summary

Fixes #4693

Opening the right workbar in conversation A currently opens it for a new conversation B. Store collapse state by session in the layout reducer so B starts collapsed and returning to A restores its preference, including after renderer reload. Bind the owner before commit so an open requested during activation is not overwritten.

This chooses persistent per-session visibility, while keeping panel topology and dimensions global. The old global maka-session-workbar-collapsed-v1 preference has no session owner and is retired in favor of v2; sessions default to collapsed once on upgrade. Please review that persistence/topology split and migration behavior against the decision requested in the issue.

Prune deleted entries only after the catalog has a committed snapshot. The catalog selector distinguishes “not loaded” from “confirmed empty,” preventing startup from deleting saved preferences.

Verification

  • New Electron regression fails against unchanged baseline b0255edcb35588b2f24efd386447d9a494c1e395 on Linux ARM64: B's panel is visible when it should be hidden.
  • Fixed macOS ARM64 build: all 8 session-workbar.spec.ts tests pass, including A open → B collapsed → A open → reload → A open/B collapsed.
  • Compiled workbar model/controller tests: 26 passed, covering persistence, old-key retirement, catalog readiness, deleted-session cleanup, malformed storage and activation-commit opening under StrictMode.
  • npm run lint, npm run format:check, npm run build, npm run typecheck, both Desktop/UI knip checks, Desktop architecture validation (including 71 checker tests), and git diff --check passed.
  • Full repository test suite and the final patch on Windows/Linux were not run. Persistence was checked through storage round-trip and renderer reload, not an OS reboot.

Before: unchanged Linux ARM64 baseline, where B inherits A's expanded panel. The fixture image lacks CJK fonts, affecting labels only.

Before: conversation B inherits the expanded panel

After: fixed macOS ARM64 build, where B stays collapsed after navigating back and reloading.

After: conversation B keeps its collapsed panel

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex assisted with repository/issue investigation, implementation, regression tests, verification, and this PR description. The commit includes Generated-by: OpenAI Codex. Human review remains required.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Keep right-panel visibility independent across sessions and preserve it across renderer restarts. Prune stored entries only after the session catalog is authoritative, and retire the ownerless global preference.

Fixes apache#4693

Generated-by: OpenAI Codex
@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Per-session workbar collapse (split from #4654)

1 participant